<template>
    <div>
      <el-dialog
      :title=dialogSettings.title
      :visible.sync=dialogSettings.visible
      :width="dialogSettings.width">
        <k-form :formHeader="formHeader" :formData="formData" />
          <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="e=>handleClick('submit', e)">确 定</el-button>
            <el-button @click="e=>handleClick('cancle',e)">取 消</el-button>
          </span> 
      </el-dialog>
       </div>
</template>

<script>
import kForm from "@/ui-components/kForm";
export default {
name: '',
props: {
  dialogSettings: {
    type: Object,
    default: () => {
      return {
        visible: true,
        title: '添加数据',
        width: '50%'
      };
    }        
  },
  formHeader: { type: Array, required: true },
  formData: { type: Object, default: () => {} }
  },
components: {kForm },
methods: {
      handleClick(type, e, index) {
        this.$emit("formSubmit", type, e, index);
      }
  }

}


/* 

*/
</script>

<style>

</style>

